{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0e15d3d0-1b4b-4207-8ac7-72078a0fd3aa",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "from openai import OpenAI\n",
    "import os\n",
    "import openai\n",
    "\n",
    "from dotenv import load_dotenv\n",
    "\n",
    "load_dotenv()\n",
    "\n",
    "print(\"++++++++++++++++\")\n",
    "print(os.environ.get(\"OPENAI_API_KEY\"))\n",
    "print(\"++++++++++++++++\")\n",
    "client = OpenAI(\n",
    "    api_key='sk-fumkL2Nvub7ibL0J3d27237a09Df4e3194EcE6E317149a60',\n",
    "    base_url='https://api.gpts.vin/v1'\n",
    ")\n",
    "\n",
    "models = client.models.list()\n",
    "\n",
    "print(models)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "88eb243c-9e03-4044-944d-8d737de665b8",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "completion = client.chat.completions.create(\n",
    "    model=\"gpt-3.5-turbo\",\n",
    "    messages=[\n",
    "        {\n",
    "            \"role\": \"user\",\n",
    "            \"content\": \"say this is a test\",\n",
    "        },\n",
    "    ]\n",
    ")\n",
    "\n",
    "print(completion.choices[0].message)\n",
    "print(completion)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "48eb011a-f1b2-4aab-80a6-eb25f9ce6647",
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install tiktoken\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f91b9b4f-98f5-4d80-8a74-c0449e909ec3",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
